package com.bwlcums.utils;

import org.springframework.beans.BeansException;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;

public class SystemContext implements ApplicationContextAware {
	
	// Spring应用上下文环境
	private static ApplicationContext applicationContext;
	
	public SystemContext() {
		
	}
	
	@Override
	public void setApplicationContext(ApplicationContext arg0)
			throws BeansException {
		SystemContext.applicationContext = arg0;
	}

	/**
	 * 获取对象
	 * 
	 * @param name
	 * @return Object
	 * @throws BeansException
	 */
	public static Object getBean(String name) throws BeansException {
		return applicationContext.getBean(name);
	}
	


}
